Migrating Database
If you are an existing CCC user planning to upgrade to the latest version and want to migrate your existing database, choose one of the following scenarios based on your current database deployment:
Migrate your PostgreSQL database
Choose one of the following PostgreSQL migration scenarios:
-
Migrate from an external PostgreSQL database to an internal PostgreSQL database
-
Migrate from an internal PostgreSQL database to an external PostgreSQL database
Internal PostgreSQL refers to a database deployed and managed within the CCC container environment. External PostgreSQL refers to a customer-managed PostgreSQL instance running outside CCC.
Migrate your existing PostgreSQL database as is
Identify the existing PostgreSQL database used by your current CCC deployment (internal or external).
Create a complete backup of the existing database by following the Backup and Restore procedure on the Data Management page.
Deploy CCC 4.5 using the appropriate installation method.
Restore the database backup into the CCC 4.5 deployment using the same Backup and Restore procedure.
Ensure that a verified backup is available before proceeding. Database migration operations require careful handling to prevent data loss or service interruption.
Migrate from an external PostgreSQL database to an internal PostgreSQL database
The steps involved in migrating your external PostgreSQL database to an internal PostgreSQL database are as follows:
Install CCC using Podman, as explained here: Installing CCC.
Log in to the virtual machine that hosts your existing PostgreSQL database.
Create a dump of the existing database:
pg_dump -h <SOURCE_DB_IP> -p 5432 -U lunadirector lunadirectordb > postgres.sql
Copy the postgres.sql file to the virtual machine running the CCC database container.
Restore the data into the internal PostgreSQL database:
psql -h <DATABASE_IP> -p 5432 -U lunadirector -f postgres.sql lunadirectordb
If CCC is deployed in HA mode, start only the primary database node before performing the migration. Complete the data migration first, then start the standby database nodes, followed by the CCC deployment.
Migrate from an internal PostgreSQL database to an external PostgreSQL database
Before proceeding, ensure that the external PostgreSQL database is freshly installed and does not contain any existing data. Configure the database according to CCC requirements to ensure compatibility and optimal performance.
The steps involved are:
Download and extract the CCC package using the link provided via email.
Log in to the virtual machine running the CCC database container.
Generate a dump of the internal database:
pg_dump -h localhost -p 5432 -U lunadirector lunadirectordb > postgres.sql
Start the target external PostgreSQL database.
Copy the postgres.sql file to the target database virtual machine and restore the data:
psql -h <TARGET_DB_IP> -p 5432 -U lunadirector -f postgres.sql lunadirectordb
Install CCC using Podman or Kubernetes, as explained here: Installing CCC.
After installation completes, log in to CCC and verify that the database data has been migrated successfully.
During CCC installation, while configuring the Master node, provide the external database details such as the database IP address and database password.
Migrate your Oracle database
To migrate from CCC 3.9 with Oracle to CCC 4.5 with PostgreSQL, complete the following two-phase migration sequence to ensure data integrity:
Upgrade CCC 3.9 (Oracle) to CCC 4.0, which migrates the database from Oracle to PostgreSQL. Follow the procedure described in the CCC 4.0 Database Migration Guide.
After completing the CCC 4.0 migration, upgrade the PostgreSQL database to CCC 4.5 by following the PostgreSQL migration steps described in this document.